package day0521;

import java.util.Arrays;
import java.util.Random;

public class Test4 {
    public static void main(String[] args) {
        int []    a={0,0,0,0,0,0};
        int[] rs=Test4.createArray(a,100);
        System.out.println(Arrays.toString(rs));
    }

    public static  int []  createArray(int []    a,int len) {
        Random ran=new Random();
        H:  for(int i=0;    ;    ){
            int num=ran.nextInt(len);
            for(int j=0;j<i;j++){
                if(num==a[j]){
                    continue  H;
                }
            }
            a[i]=num;
            i++;
            if(i== a.length){
                break;
            }
        }
        Arrays.sort(a);
        return a;
    }
}
